JNLP_FILE="subtranslator.jnlp"
HTTP_BASE="https://subtitle-translator.googlecode.com/svn/trunk/"

echo "<?xml version=\"1.0\" encoding=\"utf-8\"?> 
<jnlp spec=\"1.0+\" codebase=\""$HTTP_BASE"\" href=\""$JNLP_FILE"\">
	<information>
		<title>Subtitle translator</title>
		<vendor>kth</vendor>
		<homepage href=\"http://code.google.com/p/subtitle-translator/\" />
		<description>Subtitle translator app</description>
		<icon href=\""$HTTP_BASE"resources/com/kth/subtranslator/tv.png\" />
		<shortcut online=\"true\">
  			<!-- create desktop shortcut -->
  			<desktop/>
  			<!-- create menu item for this app -->
  			<menu submenu=\"Subtitle Translator\"/>
		</shortcut>
	</information>
	<security>
		<all-permissions/>
	</security>
	<update check=\"always\" policy=\"always\" />
	<resources>
		<j2se version=\"1.6+\" />
		<jar href=\"build/subtitletranslator.jar\" />" > $JNLP_FILE
for i in `find libs/ -name \*.jar`; do
	echo -e "\t\t<jar href=\""$i"\" />" >> $JNLP_FILE
done;

echo -e "\t</resources>\n\t<application-desc main-class=\"com.kth.subtranslator.SubTranslatorApp\" />
</jnlp>" >> $JNLP_FILE
